/*
 * @Author: Guojian Wang 1085844536@qq.com
 * @Date: 2023-03-26 22:58:34
 * @LastEditTime: 2023-03-26 23:40:24
 * @LastEditors: Guojian Wang 1085844536@qq.com
 * @FilePath: \admind:\Developer\WGJ\VSCode_WorkSpace\Web\typescript\code\chapter01\part2\src\app.ts
 * @Description:
 */
import { hi } from './m.js';
let a = 10;
// 这是一个注释
console.log(hi);
console.log(a);

// a = 'hello';

function fn(a: number, b: number) {
    return a + b;
}

function fn2(this: Window) {
    alert(this);
}

let box1 = document.getElementById('box1');

// if (box1 != null) {
//     box1.addEventListener('click', function name() {
//         alert('hello');
//     });
// }

box1?.addEventListener('click', function name() {
    alert('hello');
});
